import java.util.ArrayList;
import java.util.List;

public class Solution1018 {
    public List<Boolean> prefixesDivBy5(int[] nums) {
        List<Boolean> list=new ArrayList<>();
        int cur=0;
        for (int num : nums) {
            cur=(cur*2+num)%5;
            if (cur==0){
                list.add(true);
            }else{
                list.add(false);
            }
        }
        return list;
    }

    public static void main(String[] args) {
        System.out.println(new Solution1018().prefixesDivBy5(new int[]{0,1,1,1,1,1}));
    }
}
